package org.dxy.middleware.dynamic.thread.pool.application.query;

import lombok.RequiredArgsConstructor;
import org.dxy.middleware.dynamic.thread.pool.application.query.repository.AThreadPoolQueryRepository;
import org.dxy.middleware.dynamic.thread.pool.application.view.ThreadPoolView;
import org.dxy.middleware.dynamic.thread.pool.domain.model.ThreadPoolAggregate;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ description: 
 * @ author: dxy 
 * @ createTime: 2025/10/3 20:20 
 */
@Service
@RequiredArgsConstructor
public class ThreadPoolQueryService {
    private final AThreadPoolQueryRepository threadPoolQueryRepository;

    public ThreadPoolView getThreadPool(String appName, String poolName) {
        return threadPoolQueryRepository.findByAppNameAndPoolName(appName,poolName);
    }

    public List<ThreadPoolView> listAllThreadPools() {
        return threadPoolQueryRepository.findAll();
    }
}
